var add_class = new Vue({
	el: '#add-class',
	data: {
		weekdays: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'],
	},
	methods: {
		beforeSubmit: function (e) {
			var class_weekday = this.$data.class_weekday
			var class_student = this.$data.class_student
			var class_begin = this.$data.class_begin
			var class_duration = this.$data.class_duration

			if (class_weekday == -1 || class_student == -1
				|| !this.$methods.checkBegin(class_begin)
				|| !this.$methods.checkDuration(class_duration)) {
				e.preventDefault();
			}
		},
		checkBegin: function(begin) {
			var re = /^\d{1,2}:\d{1,2}$/
			return re.test(begin)
		},
		checkDuration: function(duration) {
			var d = parseFloat(duration)
			return d > 0 && d < 120
		}
	}
})

var navbar = new Vue({
	el: '#navbar',
	data: {
		tabs: ['课程', '学生'],
		brand_url: '/school',
		current: 0,
	},
	methods: {
	}
})